package cn.zyq.ykb.beans.sys;

import cn.zyq.ykb.system.common.BaseBean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * 部门表
 * 2023-05-12 20:14:08
 */
@Entity
@Table(name ="`sysDept`")
@Data
public class SysDept extends BaseBean implements Serializable {

	private static final long serialVersionUID = 3781211223737235123L;

	/**
	 * 部门id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "JDBC")
	@Column(name = "`sysDeptID`")
	@ApiModelProperty("部门id")
	private Integer sysDeptID;

	/**
	 * 父部门id
	 */
	@Column(name = "`parentId`")
	@ApiModelProperty("父部门id")
	private Integer parentId;

	/**
	 * 祖级列表
	 */
	@Column(name = "`ancestors`")
	@ApiModelProperty("祖级列表")
	private String ancestors;

	/**
	 * 部门名称
	 */
	@Column(name = "`deptName`")
	@ApiModelProperty("部门名称")
	private String deptName;

	/**
	 * 显示顺序
	 */
	@Column(name = "`orderNum`")
	@ApiModelProperty("显示顺序")
	private Integer orderNum;

	/**
	 * 负责人
	 */
	@Column(name = "`leader`")
	@ApiModelProperty("负责人")
	private String leader;

	/**
	 * 联系电话
	 */
	@Column(name = "`phone`")
	@ApiModelProperty("联系电话")
	private String phone;

	/**
	 * 邮箱
	 */
	@Column(name = "`email`")
	@ApiModelProperty("邮箱")
	private String email;

	/**
	 * 部门状态（0正常 1停用）
	 */
	@Column(name = "`status`")
	@ApiModelProperty("部门状态（0正常 1停用）")
	private String status;

	@Transient
	private String parentName;


	/** 子部门 */
	@Transient
	private List<SysDept> children = new ArrayList<SysDept>();

}
